#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QWidget>
#include <QLine>
#include <QPolygon>
#include <QLabel>

namespace Ui {
class MainWindow;
}

class MainWindow : public QWidget
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void paintEvent(QPaintEvent *e);
    void mousePressEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);

private:
    QTransform transform() const;

    Ui::MainWindow *ui;
    bool m_mouseDown;
    QLine m_line;
    bool m_lineValid;
    QPolygon m_path;
    bool m_pathValid;

    QLabel *m_label;
};

#endif // MAINWINDOW_H
